package realestate.manager.request;

import realestate.entity.RealEstate;

import java.util.Set;
import java.util.TreeSet;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 08.04.11
 * Time: 16:25
 * To change this template use File | Settings | File Templates.
 */
public abstract class RealEstateRequest extends ObjectOnMapShortRequest  {

	public static final Set<String> columns = new TreeSet<String>();

	static {
		columns.add(RealEstate.FIELD_PRICE_LOCAL);
		columns.add(RealEstate.FIELD_PRICE_USD);
		columns.add(RealEstate.FIELD_SQUARE);
	}

	private StringBuilder filter_builder = new StringBuilder(2000);

	@Override
	protected boolean isRequestParameter(String parameter_name) {
		return columns.contains(parameter_name) || super.isRequestParameter(parameter_name);
	}

	@Override
	protected StringBuilder getFilterBuilder() {
		return filter_builder;
	}

	@Override
	public String buildFilterString() {
		return filter_builder.append(" ")+super.buildFilterString();
	}
}
